Need to check windows.length before checking first window.
https://bugzilla.gnome.org/show_bug.cgi?id=597466
// Display the app windows menu items and the separator between windows
// of the current desktop and other windows.
let activeWorkspace = global.screen.get_active_workspace();
- let separatorShown = windows[0].get_workspace() != activeWorkspace;
+ let separatorShown = windows.length > 0 && windows[0].get_workspace() != activeWorkspace;
for (let i = 0; i < windows.length; i++) {
if (!separatorShown && windows[i].get_workspace() != activeWorkspace) {